<html>
<head>
<meta http-equiv=Content-Type content=text/html;charset=utf-8>
<#include "../inc/commonJs.html">
<script type="text/JavaScript">
	function doSave(){
		var url = "<#if emailid??>editEmail.do?emailid=${emailid}<#else>addEmail.do</#if>";
		$('form').form('submit',{  
		    url:url,
		    onSubmit:function(param){
		    	if(document.all!=1){
		    		 param.receiver = $('#receiver').combobox('getText');    
	        		 param.receiverids = $('#receiver').combobox('getValues');
		    	}
		        return $(this).form('validate');  
		    }, 
		    success:function(data){  
				top.closemodalwindow(true,data);
		    }  
		});
	}
	function sendEmail(){
		var url = "<#if emailid??>editEmail.do?emailid=${emailid}<#else>addEmail.do</#if>";
		$('form').form('submit',{  
		    url:url,
		    onSubmit:function(param){
		    	if(document.all!=1){
		    		param.zt = 1;
		    		param.receiver = $('#receiver').combobox('getText');    
	        		param.receiverids = $('#receiver').combobox('getValues');
		    	}
		        return $(this).form('validate');  
		    }, 
		    success:function(data){  
				top.closemodalwindow(true,data);
		    }  
		});
	}
	//
	function sendRealEmail(){
		$.messager.progress({ title:'请等待', msg:'正在发送中...' });
		$('form').form('submit',{  
		    url:'sendRealEmail.do?emailid=${obj.emailid!}',
		    onSubmit:function(){
		        return $(this).form('validate');  
		    }, 
		    success:function(data){ 
		    	$.messager.progress('close');
				top.closemodalwindow(true,data);
		    }  
		});
	}
	//
	$(function(){
		if('${obj.receiverids!}'){
			$('#receiver').combobox('setValues', [${obj.receiverids!}]);
		}
	})
</script>

</head>
<body>
<table border="0" width="98%" cellpadding="0" cellspacing="0" align="center" class="table_all">
<form align="center" method="post">
      <tr>
        <td height="32" class="td_table_1"><span class="smallFont">收件人：</span></td>
        <td height="32" class="td_table_2"><div align="left">&nbsp;
            <input id="receiver" class="easyui-combobox" required="true" style="width:300px;" panelHeight="auto" data-options="multiple:true,valueField:'userid',textField:'username',url:'../system/listUserForCombox.do'" />
          </div></td>
      </tr>
      <#if realEamil??>
	      <tr>
	        <td height="32" class="td_table_1"><span class="smallFont">收件人邮箱：</span></td>
	        <td height="32" class="td_table_2"><div align="left">&nbsp;
	            <input name="cc" id="cc" value="${realEamil!}" required="true" class="easyui-validatebox" maxlength="200" style="width:300px;" type="text" >
	          </div></td>
	      </tr>
      </#if>
      <tr>
        <td height="32" class="td_table_1"><span class="smallFont">标题：</span></td>
        <td height="32" class="td_table_2"><div align="left">&nbsp;
            <input name="title" value="${obj.title!}" class="easyui-validatebox" required="true" maxlength="30" style="width:300px;" type="text" >
          </div></td>
      </tr>
      <tr>
        <td height="32" class="td_table_1"><span class="smallFont">内容：</span></td>
        <td height="32" class="td_table_2">&nbsp;
          <textarea rows="5" name="content" cols="29" style="width:300px;"  >${obj.content!}</textarea></td>
      </tr>
</form>
  </table>
</body>
</html>